{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 特征选择Wrapper（包裹法：根据目标函数（通常是预测效果评分），每次选择若干特征，或者排除若干特征）里面有个很重要的东西，递归特征消除，Recursive Feature Elimination，简称RFE。\n",
    "#### RFE:我们采用某一个模型，例如逻辑回归LogisticRegression，针对我们的数据进行多次的训练，每一次训练后，都会根据权值系数来移除权重比较低的特征，此时，再根据新的特征，继续下一轮的特征，这就是递归特征消除"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import seaborn as sns\n",
    "import scipy.stats as stats\n",
    "import statsmodels.api as sm\n",
    "import statsmodels.api as sm\n",
    "from statsmodels.formula.api import ols\n",
    "from scipy.stats import chi2_contingency\n",
    "import matplotlib.pyplot as plt\n",
    "import sklearn\n",
    "from sklearn import feature_selection\n",
    "from sklearn.ensemble import RandomForestClassifier\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.feature_selection import RFE\n",
    "from sklearn.metrics import confusion_matrix, classification_report, roc_curve, roc_auc_score\n",
    "from sklearn.metrics import accuracy_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 导入数据\n",
    "data_=pd.read_csv(\"StudentPerformance.csv\")\n",
    "df=data_.copy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gender</th>\n",
       "      <th>NationalITy</th>\n",
       "      <th>PlaceofBirth</th>\n",
       "      <th>StageID</th>\n",
       "      <th>GradeID</th>\n",
       "      <th>SectionID</th>\n",
       "      <th>Topic</th>\n",
       "      <th>Semester</th>\n",
       "      <th>Relation</th>\n",
       "      <th>raisedhands</th>\n",
       "      <th>VisITedResources</th>\n",
       "      <th>AnnouncementsView</th>\n",
       "      <th>Discussion</th>\n",
       "      <th>ParentAnsweringSurvey</th>\n",
       "      <th>ParentschoolSatisfaction</th>\n",
       "      <th>StudentAbsenceDays</th>\n",
       "      <th>Class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>M</td>\n",
       "      <td>KW</td>\n",
       "      <td>KuwaIT</td>\n",
       "      <td>lowerlevel</td>\n",
       "      <td>G-04</td>\n",
       "      <td>A</td>\n",
       "      <td>IT</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>15</td>\n",
       "      <td>16</td>\n",
       "      <td>2</td>\n",
       "      <td>20</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Good</td>\n",
       "      <td>Under-7</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>M</td>\n",
       "      <td>KW</td>\n",
       "      <td>KuwaIT</td>\n",
       "      <td>lowerlevel</td>\n",
       "      <td>G-04</td>\n",
       "      <td>A</td>\n",
       "      <td>IT</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>20</td>\n",
       "      <td>20</td>\n",
       "      <td>3</td>\n",
       "      <td>25</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Good</td>\n",
       "      <td>Under-7</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>M</td>\n",
       "      <td>KW</td>\n",
       "      <td>KuwaIT</td>\n",
       "      <td>lowerlevel</td>\n",
       "      <td>G-04</td>\n",
       "      <td>A</td>\n",
       "      <td>IT</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>10</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>30</td>\n",
       "      <td>No</td>\n",
       "      <td>Bad</td>\n",
       "      <td>Above-7</td>\n",
       "      <td>L</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>M</td>\n",
       "      <td>KW</td>\n",
       "      <td>KuwaIT</td>\n",
       "      <td>lowerlevel</td>\n",
       "      <td>G-04</td>\n",
       "      <td>A</td>\n",
       "      <td>IT</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>30</td>\n",
       "      <td>25</td>\n",
       "      <td>5</td>\n",
       "      <td>35</td>\n",
       "      <td>No</td>\n",
       "      <td>Bad</td>\n",
       "      <td>Above-7</td>\n",
       "      <td>L</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>M</td>\n",
       "      <td>KW</td>\n",
       "      <td>KuwaIT</td>\n",
       "      <td>lowerlevel</td>\n",
       "      <td>G-04</td>\n",
       "      <td>A</td>\n",
       "      <td>IT</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>40</td>\n",
       "      <td>50</td>\n",
       "      <td>12</td>\n",
       "      <td>50</td>\n",
       "      <td>No</td>\n",
       "      <td>Bad</td>\n",
       "      <td>Above-7</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>475</th>\n",
       "      <td>F</td>\n",
       "      <td>Jordan</td>\n",
       "      <td>Jordan</td>\n",
       "      <td>MiddleSchool</td>\n",
       "      <td>G-08</td>\n",
       "      <td>A</td>\n",
       "      <td>Chemistry</td>\n",
       "      <td>S</td>\n",
       "      <td>Father</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>8</td>\n",
       "      <td>No</td>\n",
       "      <td>Bad</td>\n",
       "      <td>Above-7</td>\n",
       "      <td>L</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>476</th>\n",
       "      <td>F</td>\n",
       "      <td>Jordan</td>\n",
       "      <td>Jordan</td>\n",
       "      <td>MiddleSchool</td>\n",
       "      <td>G-08</td>\n",
       "      <td>A</td>\n",
       "      <td>Geology</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>50</td>\n",
       "      <td>77</td>\n",
       "      <td>14</td>\n",
       "      <td>28</td>\n",
       "      <td>No</td>\n",
       "      <td>Bad</td>\n",
       "      <td>Under-7</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>477</th>\n",
       "      <td>F</td>\n",
       "      <td>Jordan</td>\n",
       "      <td>Jordan</td>\n",
       "      <td>MiddleSchool</td>\n",
       "      <td>G-08</td>\n",
       "      <td>A</td>\n",
       "      <td>Geology</td>\n",
       "      <td>S</td>\n",
       "      <td>Father</td>\n",
       "      <td>55</td>\n",
       "      <td>74</td>\n",
       "      <td>25</td>\n",
       "      <td>29</td>\n",
       "      <td>No</td>\n",
       "      <td>Bad</td>\n",
       "      <td>Under-7</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>478</th>\n",
       "      <td>F</td>\n",
       "      <td>Jordan</td>\n",
       "      <td>Jordan</td>\n",
       "      <td>MiddleSchool</td>\n",
       "      <td>G-08</td>\n",
       "      <td>A</td>\n",
       "      <td>History</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>30</td>\n",
       "      <td>17</td>\n",
       "      <td>14</td>\n",
       "      <td>57</td>\n",
       "      <td>No</td>\n",
       "      <td>Bad</td>\n",
       "      <td>Above-7</td>\n",
       "      <td>L</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>479</th>\n",
       "      <td>F</td>\n",
       "      <td>Jordan</td>\n",
       "      <td>Jordan</td>\n",
       "      <td>MiddleSchool</td>\n",
       "      <td>G-08</td>\n",
       "      <td>A</td>\n",
       "      <td>History</td>\n",
       "      <td>S</td>\n",
       "      <td>Father</td>\n",
       "      <td>35</td>\n",
       "      <td>14</td>\n",
       "      <td>23</td>\n",
       "      <td>62</td>\n",
       "      <td>No</td>\n",
       "      <td>Bad</td>\n",
       "      <td>Above-7</td>\n",
       "      <td>L</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>480 rows × 17 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    gender NationalITy PlaceofBirth       StageID GradeID SectionID  \\\n",
       "0        M          KW       KuwaIT    lowerlevel    G-04         A   \n",
       "1        M          KW       KuwaIT    lowerlevel    G-04         A   \n",
       "2        M          KW       KuwaIT    lowerlevel    G-04         A   \n",
       "3        M          KW       KuwaIT    lowerlevel    G-04         A   \n",
       "4        M          KW       KuwaIT    lowerlevel    G-04         A   \n",
       "..     ...         ...          ...           ...     ...       ...   \n",
       "475      F      Jordan       Jordan  MiddleSchool    G-08         A   \n",
       "476      F      Jordan       Jordan  MiddleSchool    G-08         A   \n",
       "477      F      Jordan       Jordan  MiddleSchool    G-08         A   \n",
       "478      F      Jordan       Jordan  MiddleSchool    G-08         A   \n",
       "479      F      Jordan       Jordan  MiddleSchool    G-08         A   \n",
       "\n",
       "         Topic Semester Relation  raisedhands  VisITedResources  \\\n",
       "0           IT        F   Father           15                16   \n",
       "1           IT        F   Father           20                20   \n",
       "2           IT        F   Father           10                 7   \n",
       "3           IT        F   Father           30                25   \n",
       "4           IT        F   Father           40                50   \n",
       "..         ...      ...      ...          ...               ...   \n",
       "475  Chemistry        S   Father            5                 4   \n",
       "476    Geology        F   Father           50                77   \n",
       "477    Geology        S   Father           55                74   \n",
       "478    History        F   Father           30                17   \n",
       "479    History        S   Father           35                14   \n",
       "\n",
       "     AnnouncementsView  Discussion ParentAnsweringSurvey  \\\n",
       "0                    2          20                   Yes   \n",
       "1                    3          25                   Yes   \n",
       "2                    0          30                    No   \n",
       "3                    5          35                    No   \n",
       "4                   12          50                    No   \n",
       "..                 ...         ...                   ...   \n",
       "475                  5           8                    No   \n",
       "476                 14          28                    No   \n",
       "477                 25          29                    No   \n",
       "478                 14          57                    No   \n",
       "479                 23          62                    No   \n",
       "\n",
       "    ParentschoolSatisfaction StudentAbsenceDays Class  \n",
       "0                       Good            Under-7     M  \n",
       "1                       Good            Under-7     M  \n",
       "2                        Bad            Above-7     L  \n",
       "3                        Bad            Above-7     L  \n",
       "4                        Bad            Above-7     M  \n",
       "..                       ...                ...   ...  \n",
       "475                      Bad            Above-7     L  \n",
       "476                      Bad            Under-7     M  \n",
       "477                      Bad            Under-7     M  \n",
       "478                      Bad            Above-7     L  \n",
       "479                      Bad            Above-7     L  \n",
       "\n",
       "[480 rows x 17 columns]"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [],
   "source": [
    "#修改列名\n",
    "df.rename(index=str,columns={\n",
    "    'gender':'Gender',\n",
    "    'NationalITy':'Nationality',\n",
    "    'raisedhands':'Raisedhands',\n",
    "    'VisITedResources':'VisitedResources'\n",
    "},inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Raisedhands</th>\n",
       "      <th>VisitedResources</th>\n",
       "      <th>AnnouncementsView</th>\n",
       "      <th>Discussion</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>480.000000</td>\n",
       "      <td>480.000000</td>\n",
       "      <td>480.000000</td>\n",
       "      <td>480.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>46.775000</td>\n",
       "      <td>54.797917</td>\n",
       "      <td>37.918750</td>\n",
       "      <td>43.283333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>30.779223</td>\n",
       "      <td>33.080007</td>\n",
       "      <td>26.611244</td>\n",
       "      <td>27.637735</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>15.750000</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>14.000000</td>\n",
       "      <td>20.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>50.000000</td>\n",
       "      <td>65.000000</td>\n",
       "      <td>33.000000</td>\n",
       "      <td>39.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>75.000000</td>\n",
       "      <td>84.000000</td>\n",
       "      <td>58.000000</td>\n",
       "      <td>70.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>100.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>98.000000</td>\n",
       "      <td>99.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Raisedhands  VisitedResources  AnnouncementsView  Discussion\n",
       "count   480.000000        480.000000         480.000000  480.000000\n",
       "mean     46.775000         54.797917          37.918750   43.283333\n",
       "std      30.779223         33.080007          26.611244   27.637735\n",
       "min       0.000000          0.000000           0.000000    1.000000\n",
       "25%      15.750000         20.000000          14.000000   20.000000\n",
       "50%      50.000000         65.000000          33.000000   39.000000\n",
       "75%      75.000000         84.000000          58.000000   70.000000\n",
       "max     100.000000         99.000000          98.000000   99.000000"
      ]
     },
     "execution_count": 108,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>Nationality</th>\n",
       "      <th>PlaceofBirth</th>\n",
       "      <th>StageID</th>\n",
       "      <th>GradeID</th>\n",
       "      <th>SectionID</th>\n",
       "      <th>Topic</th>\n",
       "      <th>Semester</th>\n",
       "      <th>Relation</th>\n",
       "      <th>Raisedhands</th>\n",
       "      <th>VisitedResources</th>\n",
       "      <th>AnnouncementsView</th>\n",
       "      <th>Discussion</th>\n",
       "      <th>ParentAnsweringSurvey</th>\n",
       "      <th>ParentschoolSatisfaction</th>\n",
       "      <th>StudentAbsenceDays</th>\n",
       "      <th>Class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>M</td>\n",
       "      <td>KW</td>\n",
       "      <td>KuwaIT</td>\n",
       "      <td>lowerlevel</td>\n",
       "      <td>G-04</td>\n",
       "      <td>A</td>\n",
       "      <td>IT</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>15</td>\n",
       "      <td>16</td>\n",
       "      <td>2</td>\n",
       "      <td>20</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Good</td>\n",
       "      <td>Under-7</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>M</td>\n",
       "      <td>KW</td>\n",
       "      <td>KuwaIT</td>\n",
       "      <td>lowerlevel</td>\n",
       "      <td>G-04</td>\n",
       "      <td>A</td>\n",
       "      <td>IT</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>20</td>\n",
       "      <td>20</td>\n",
       "      <td>3</td>\n",
       "      <td>25</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Good</td>\n",
       "      <td>Under-7</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>M</td>\n",
       "      <td>KW</td>\n",
       "      <td>KuwaIT</td>\n",
       "      <td>lowerlevel</td>\n",
       "      <td>G-04</td>\n",
       "      <td>A</td>\n",
       "      <td>IT</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>10</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>30</td>\n",
       "      <td>No</td>\n",
       "      <td>Bad</td>\n",
       "      <td>Above-7</td>\n",
       "      <td>L</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>M</td>\n",
       "      <td>KW</td>\n",
       "      <td>KuwaIT</td>\n",
       "      <td>lowerlevel</td>\n",
       "      <td>G-04</td>\n",
       "      <td>A</td>\n",
       "      <td>IT</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>30</td>\n",
       "      <td>25</td>\n",
       "      <td>5</td>\n",
       "      <td>35</td>\n",
       "      <td>No</td>\n",
       "      <td>Bad</td>\n",
       "      <td>Above-7</td>\n",
       "      <td>L</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>M</td>\n",
       "      <td>KW</td>\n",
       "      <td>KuwaIT</td>\n",
       "      <td>lowerlevel</td>\n",
       "      <td>G-04</td>\n",
       "      <td>A</td>\n",
       "      <td>IT</td>\n",
       "      <td>F</td>\n",
       "      <td>Father</td>\n",
       "      <td>40</td>\n",
       "      <td>50</td>\n",
       "      <td>12</td>\n",
       "      <td>50</td>\n",
       "      <td>No</td>\n",
       "      <td>Bad</td>\n",
       "      <td>Above-7</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Gender Nationality PlaceofBirth     StageID GradeID SectionID Topic  \\\n",
       "0      M          KW       KuwaIT  lowerlevel    G-04         A    IT   \n",
       "1      M          KW       KuwaIT  lowerlevel    G-04         A    IT   \n",
       "2      M          KW       KuwaIT  lowerlevel    G-04         A    IT   \n",
       "3      M          KW       KuwaIT  lowerlevel    G-04         A    IT   \n",
       "4      M          KW       KuwaIT  lowerlevel    G-04         A    IT   \n",
       "\n",
       "  Semester Relation  Raisedhands  VisitedResources  AnnouncementsView  \\\n",
       "0        F   Father           15                16                  2   \n",
       "1        F   Father           20                20                  3   \n",
       "2        F   Father           10                 7                  0   \n",
       "3        F   Father           30                25                  5   \n",
       "4        F   Father           40                50                 12   \n",
       "\n",
       "   Discussion ParentAnsweringSurvey ParentschoolSatisfaction  \\\n",
       "0          20                   Yes                     Good   \n",
       "1          25                   Yes                     Good   \n",
       "2          30                    No                      Bad   \n",
       "3          35                    No                      Bad   \n",
       "4          50                    No                      Bad   \n",
       "\n",
       "  StudentAbsenceDays Class  \n",
       "0            Under-7     M  \n",
       "1            Under-7     M  \n",
       "2            Above-7     L  \n",
       "3            Above-7     L  \n",
       "4            Above-7     M  "
      ]
     },
     "execution_count": 109,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['Gender', 'Nationality', 'PlaceofBirth', 'StageID', 'GradeID',\n",
       "       'SectionID', 'Topic', 'Semester', 'Relation', 'Raisedhands',\n",
       "       'VisitedResources', 'AnnouncementsView', 'Discussion',\n",
       "       'ParentAnsweringSurvey', 'ParentschoolSatisfaction',\n",
       "       'StudentAbsenceDays', 'Class'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 110,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['M', 'F'], dtype=object)"
      ]
     },
     "execution_count": 111,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['Gender'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['KW', 'lebanon', 'Egypt', 'SaudiArabia', 'USA', 'Jordan',\n",
       "       'venzuela', 'Iran', 'Tunis', 'Morocco', 'Syria', 'Palestine',\n",
       "       'Iraq', 'Lybia'], dtype=object)"
      ]
     },
     "execution_count": 112,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['Nationality'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Gender                      480\n",
       "Nationality                 480\n",
       "PlaceofBirth                480\n",
       "StageID                     480\n",
       "GradeID                     480\n",
       "SectionID                   480\n",
       "Topic                       480\n",
       "Semester                    480\n",
       "Relation                    480\n",
       "Raisedhands                 480\n",
       "VisitedResources            480\n",
       "AnnouncementsView           480\n",
       "Discussion                  480\n",
       "ParentAnsweringSurvey       480\n",
       "ParentschoolSatisfaction    480\n",
       "StudentAbsenceDays          480\n",
       "Class                       480\n",
       "dtype: int64"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Gender                      0\n",
       "Nationality                 0\n",
       "PlaceofBirth                0\n",
       "StageID                     0\n",
       "GradeID                     0\n",
       "SectionID                   0\n",
       "Topic                       0\n",
       "Semester                    0\n",
       "Relation                    0\n",
       "Raisedhands                 0\n",
       "VisitedResources            0\n",
       "AnnouncementsView           0\n",
       "Discussion                  0\n",
       "ParentAnsweringSurvey       0\n",
       "ParentschoolSatisfaction    0\n",
       "StudentAbsenceDays          0\n",
       "Class                       0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [],
   "source": [
    "df=df.dropna()#df.dropna()函数用于删除dataframe数据中的缺失数据，即删除NaN数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Gender                      480\n",
       "Nationality                 480\n",
       "PlaceofBirth                480\n",
       "StageID                     480\n",
       "GradeID                     480\n",
       "SectionID                   480\n",
       "Topic                       480\n",
       "Semester                    480\n",
       "Relation                    480\n",
       "Raisedhands                 480\n",
       "VisitedResources            480\n",
       "AnnouncementsView           480\n",
       "Discussion                  480\n",
       "ParentAnsweringSurvey       480\n",
       "ParentschoolSatisfaction    480\n",
       "StudentAbsenceDays          480\n",
       "Class                       480\n",
       "dtype: int64"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Gender                      object\n",
       "Nationality                 object\n",
       "PlaceofBirth                object\n",
       "StageID                     object\n",
       "GradeID                     object\n",
       "SectionID                   object\n",
       "Topic                       object\n",
       "Semester                    object\n",
       "Relation                    object\n",
       "Raisedhands                  int64\n",
       "VisitedResources             int64\n",
       "AnnouncementsView            int64\n",
       "Discussion                   int64\n",
       "ParentAnsweringSurvey       object\n",
       "ParentschoolSatisfaction    object\n",
       "StudentAbsenceDays          object\n",
       "Class                       object\n",
       "dtype: object"
      ]
     },
     "execution_count": 117,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.dtypes#查看列属性"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 118,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbwAAAFbCAYAAACu8TvlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAuP0lEQVR4nO3de9xnY73/8dfbIOOQQ3QacsohiomhnCWk2oVdQkrt1KQf2eqnvVP7F2nvjbI7qjRJRaKjkhTtipGIGYZhpGajTLRrIufTzP3+/bHWbb5u9zHr+72+3ev99FiP+a7TtT73mnF/vte1rnVdsk1ER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VET0i6DjgNmAssHdxue26xoKJVkvAioickzbW9bek4or2S8CKiJyQdD/wJOI9qxnMA0os1eiUJLyJ6QtKtw2y27Y16Hky0UhJeRES0QnppRkTPSNqRJ/fSPLNYQNEqSXgR0ROSzgI2BuaxrJemgSS86Ik0aUZET0i6CdjC+aUThWS2hIjolRuAZ5cOItorTZoR0StrAwskXcWy1xJse9+CMUWLpEkzInpC0m6dq1SDSB9se8tCIUXLpEkzInrC9qXAPVRzBH4FeDnVUGMRPZEmzYjoqnrQ6IOoJsT9C/ANqtallxUNLFonTZoR0VWSBoDLgMNsL6y33ZIRVqLX0qQZEd32OuCPwM8lfVHSy6me4UX0VGp4EdETklYB9qNq2twD+Cpwnu2LS8YV7ZGEFxE9J2kt4ADgwEwAG72ShBcREa2QZ3gREdEKSXgREdEKSXgREdEKSXgREdEK/x8/QCTVfLGTtgAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#绘制列的热力图\n",
    "cor=df.corr()\n",
    "sns.heatmap(cor)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Raisedhands</th>\n",
       "      <th>VisitedResources</th>\n",
       "      <th>AnnouncementsView</th>\n",
       "      <th>Discussion</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Raisedhands</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.691572</td>\n",
       "      <td>0.643918</td>\n",
       "      <td>0.339386</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>VisitedResources</th>\n",
       "      <td>0.691572</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.594500</td>\n",
       "      <td>0.243292</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AnnouncementsView</th>\n",
       "      <td>0.643918</td>\n",
       "      <td>0.594500</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.417290</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Discussion</th>\n",
       "      <td>0.339386</td>\n",
       "      <td>0.243292</td>\n",
       "      <td>0.417290</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   Raisedhands  VisitedResources  AnnouncementsView  \\\n",
       "Raisedhands           1.000000          0.691572           0.643918   \n",
       "VisitedResources      0.691572          1.000000           0.594500   \n",
       "AnnouncementsView     0.643918          0.594500           1.000000   \n",
       "Discussion            0.339386          0.243292           0.417290   \n",
       "\n",
       "                   Discussion  \n",
       "Raisedhands          0.339386  \n",
       "VisitedResources     0.243292  \n",
       "AnnouncementsView    0.417290  \n",
       "Discussion           1.000000  "
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from sklearn.ensemble import RandomForestClassifier as RFC\n",
    "from sklearn.model_selection import cross_val_score\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "from sklearn.feature_selection import RFECV\n",
    "from sklearn.feature_selection import RFE\n",
    "from sklearn.linear_model import LogisticRegression \n",
    "\n",
    "# 1.读取训练数据集\n",
    "df = pd.read_csv(r\"StudentPerformance.csv\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {},
   "outputs": [],
   "source": [
    "#修改列名\n",
    "df.rename(index=str,columns={\n",
    "    'gender':'Gender',\n",
    "    'NationalITy':'Nationality',\n",
    "    'raisedhands':'Raisedhands',\n",
    "    'VisITedResources':'VisitedResources'\n",
    "},inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [],
   "source": [
    "#将object类型的列重定义为category\n",
    "df['Gender']=df['Gender'].astype('category')\n",
    "df['Nationality']=df['Nationality'].astype('category')\n",
    "df['PlaceofBirth']=df['PlaceofBirth'].astype('category')\n",
    "df['StageID']=df['StageID'].astype('category')\n",
    "df['GradeID']=df['GradeID'].astype('category')\n",
    "df['SectionID']=df['SectionID'].astype('category')\n",
    "df['Topic']=df['Topic'].astype('category')\n",
    "df['Semester']=df['Semester'].astype('category')\n",
    "df['Relation']=df['Relation'].astype('category')\n",
    "df['ParentAnsweringSurvey']=df['ParentAnsweringSurvey'].astype('category')\n",
    "df['ParentschoolSatisfaction']=df['ParentschoolSatisfaction'].astype('category')\n",
    "df['StudentAbsenceDays']=df['StudentAbsenceDays'].astype('category')\n",
    "df['Class']=df['Class'].astype('category')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {},
   "outputs": [],
   "source": [
    "#独热编码\n",
    "df['Gender']=df['Gender'].cat.codes\n",
    "df['Nationality']=df['Nationality'].cat.codes\n",
    "df['PlaceofBirth']=df['PlaceofBirth'].cat.codes\n",
    "df['StageID']=df['StageID'].cat.codes\n",
    "df['GradeID']=df['GradeID'].cat.codes\n",
    "df['SectionID']=df['SectionID'].cat.codes\n",
    "df['Topic']=df['Topic'].cat.codes\n",
    "df['Semester']=df['Semester'].cat.codes\n",
    "df['Relation']=df['Relation'].cat.codes\n",
    "df['ParentAnsweringSurvey']=df['ParentAnsweringSurvey'].cat.codes\n",
    "df['ParentschoolSatisfaction']=df['ParentschoolSatisfaction'].cat.codes\n",
    "df['StudentAbsenceDays']=df['StudentAbsenceDays'].cat.codes\n",
    "df['Class']=df['Class'].cat.codes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      1\n",
       "1      1\n",
       "2      1\n",
       "3      1\n",
       "4      1\n",
       "      ..\n",
       "475    0\n",
       "476    0\n",
       "477    0\n",
       "478    0\n",
       "479    0\n",
       "Name: Gender, Length: 480, dtype: int8"
      ]
     },
     "execution_count": 124,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['Gender'] #查看性别独热编码后的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Gender                       int8\n",
       "Nationality                  int8\n",
       "PlaceofBirth                 int8\n",
       "StageID                      int8\n",
       "GradeID                      int8\n",
       "SectionID                    int8\n",
       "Topic                        int8\n",
       "Semester                     int8\n",
       "Relation                     int8\n",
       "Raisedhands                 int64\n",
       "VisitedResources            int64\n",
       "AnnouncementsView           int64\n",
       "Discussion                  int64\n",
       "ParentAnsweringSurvey        int8\n",
       "ParentschoolSatisfaction     int8\n",
       "StudentAbsenceDays           int8\n",
       "Class                        int8\n",
       "dtype: object"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.dtypes #查看列属性"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(480, 16)\n"
     ]
    }
   ],
   "source": [
    "X=df.iloc[:,:-1]\n",
    "Y=df.iloc[:,-1]\n",
    "print(X.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>Nationality</th>\n",
       "      <th>PlaceofBirth</th>\n",
       "      <th>StageID</th>\n",
       "      <th>GradeID</th>\n",
       "      <th>SectionID</th>\n",
       "      <th>Topic</th>\n",
       "      <th>Semester</th>\n",
       "      <th>Relation</th>\n",
       "      <th>Raisedhands</th>\n",
       "      <th>VisitedResources</th>\n",
       "      <th>AnnouncementsView</th>\n",
       "      <th>Discussion</th>\n",
       "      <th>ParentAnsweringSurvey</th>\n",
       "      <th>ParentschoolSatisfaction</th>\n",
       "      <th>StudentAbsenceDays</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>15</td>\n",
       "      <td>16</td>\n",
       "      <td>2</td>\n",
       "      <td>20</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20</td>\n",
       "      <td>20</td>\n",
       "      <td>3</td>\n",
       "      <td>25</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>30</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30</td>\n",
       "      <td>25</td>\n",
       "      <td>5</td>\n",
       "      <td>35</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>50</td>\n",
       "      <td>12</td>\n",
       "      <td>50</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>475</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>476</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>50</td>\n",
       "      <td>77</td>\n",
       "      <td>14</td>\n",
       "      <td>28</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>477</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>55</td>\n",
       "      <td>74</td>\n",
       "      <td>25</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>478</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30</td>\n",
       "      <td>17</td>\n",
       "      <td>14</td>\n",
       "      <td>57</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>479</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>35</td>\n",
       "      <td>14</td>\n",
       "      <td>23</td>\n",
       "      <td>62</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>480 rows × 16 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Gender  Nationality  PlaceofBirth  StageID  GradeID  SectionID  Topic  \\\n",
       "0         1            4             4        2        1          0      7   \n",
       "1         1            4             4        2        1          0      7   \n",
       "2         1            4             4        2        1          0      7   \n",
       "3         1            4             4        2        1          0      7   \n",
       "4         1            4             4        2        1          0      7   \n",
       "..      ...          ...           ...      ...      ...        ...    ...   \n",
       "475       0            3             3        1        5          0      2   \n",
       "476       0            3             3        1        5          0      5   \n",
       "477       0            3             3        1        5          0      5   \n",
       "478       0            3             3        1        5          0      6   \n",
       "479       0            3             3        1        5          0      6   \n",
       "\n",
       "     Semester  Relation  Raisedhands  VisitedResources  AnnouncementsView  \\\n",
       "0           0         0           15                16                  2   \n",
       "1           0         0           20                20                  3   \n",
       "2           0         0           10                 7                  0   \n",
       "3           0         0           30                25                  5   \n",
       "4           0         0           40                50                 12   \n",
       "..        ...       ...          ...               ...                ...   \n",
       "475         1         0            5                 4                  5   \n",
       "476         0         0           50                77                 14   \n",
       "477         1         0           55                74                 25   \n",
       "478         0         0           30                17                 14   \n",
       "479         1         0           35                14                 23   \n",
       "\n",
       "     Discussion  ParentAnsweringSurvey  ParentschoolSatisfaction  \\\n",
       "0            20                      1                         1   \n",
       "1            25                      1                         1   \n",
       "2            30                      0                         0   \n",
       "3            35                      0                         0   \n",
       "4            50                      0                         0   \n",
       "..          ...                    ...                       ...   \n",
       "475           8                      0                         0   \n",
       "476          28                      0                         0   \n",
       "477          29                      0                         0   \n",
       "478          57                      0                         0   \n",
       "479          62                      0                         0   \n",
       "\n",
       "     StudentAbsenceDays  \n",
       "0                     1  \n",
       "1                     1  \n",
       "2                     0  \n",
       "3                     0  \n",
       "4                     0  \n",
       "..                  ...  \n",
       "475                   0  \n",
       "476                   1  \n",
       "477                   1  \n",
       "478                   0  \n",
       "479                   0  \n",
       "\n",
       "[480 rows x 16 columns]"
      ]
     },
     "execution_count": 127,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      2\n",
       "1      2\n",
       "2      1\n",
       "3      1\n",
       "4      2\n",
       "      ..\n",
       "475    1\n",
       "476    2\n",
       "477    2\n",
       "478    1\n",
       "479    1\n",
       "Name: Class, Length: 480, dtype: int8"
      ]
     },
     "execution_count": 128,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Y"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1.将筛选的k个特征作为初始特征子集输入到线性回归分类器中，计算得到每个特征的重要性，并利用交叉验证方法得到初始特征子集的分类精度；"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1.标准化处理\n",
    "scaler = StandardScaler()\n",
    "X_train = scaler.fit_transform(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "重要性：\n",
      "[0.02172526 0.03592943 0.03470839 0.01623346 0.0352202  0.019724\n",
      " 0.04980138 0.00928312 0.04551954 0.14911033 0.18133543 0.11580336\n",
      " 0.08638371 0.04014751 0.02663459 0.13244026]\n"
     ]
    }
   ],
   "source": [
    "# 2.构建模型\n",
    "RFC_ = RFC()                               # 随机森林\n",
    "c = RFC_.fit(X, Y).feature_importances_    # 特征重要性\n",
    "print(\"重要性：\")\n",
    "print(c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>#sk-container-id-3 {color: black;background-color: white;}#sk-container-id-3 pre{padding: 0;}#sk-container-id-3 div.sk-toggleable {background-color: white;}#sk-container-id-3 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-3 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-3 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-3 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-3 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-3 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-3 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-3 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-3 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-3 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-3 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-3 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-3 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-3 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-3 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-3 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-3 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-3 div.sk-item {position: relative;z-index: 1;}#sk-container-id-3 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-3 div.sk-item::before, #sk-container-id-3 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-3 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-3 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-3 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-3 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-3 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-3 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-3 div.sk-label-container {text-align: center;}#sk-container-id-3 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-3 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-3\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>RandomForestClassifier()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-3\" type=\"checkbox\" checked><label for=\"sk-estimator-id-3\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">RandomForestClassifier</label><div class=\"sk-toggleable__content\"><pre>RandomForestClassifier()</pre></div></div></div></div></div>"
      ],
      "text/plain": [
       "RandomForestClassifier()"
      ]
     },
     "execution_count": 131,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "RFC_.fit(X,Y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2.从当前特征子集中移除特征重要性最低的一个特征，得到一个新的特征子集，再次输入到线性回归分类器中，计算新的特征子集中每个特征的重要性，并利用交叉验证方法得到新的特征子集的分类精度。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.6979166666666666\n"
     ]
    }
   ],
   "source": [
    "# 3. 交叉验证递归特征消除法\n",
    "selector = RFECV(RFC_, step=1, cv=10)       # 采用交叉验证，每次排除一个特征，筛选出最优特征\n",
    "selector = selector.fit(X, Y)\n",
    "X_wrapper = selector.transform(X)          # 最优特征\n",
    "score =cross_val_score(RFC_ , X_wrapper, Y, cv=10).mean()   # 最优特征分类结果\n",
    "print(score)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "选取结果\n",
      "[ True  True  True False  True False  True False  True  True  True  True\n",
      "  True  True  True  True]\n",
      "选取特征数量\n",
      "13\n",
      "依次排数特征排序\n",
      "[1 1 1 3 1 2 1 4 1 1 1 1 1 1 1 1]\n"
     ]
    }
   ],
   "source": [
    "print(\"选取结果\")\n",
    "print(selector.support_)                                    # 选取结果\n",
    "print(\"选取特征数量\")\n",
    "print(selector.n_features_)                                 # 选取特征数量\n",
    "print(\"依次排数特征排序\")\n",
    "print(selector.ranking_)                                    # 依次排数特征排序"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.递归的重复步骤2，直至特征子集为空，最后一共得到k个不同特征数量的特征子集，选择分类精度最高的特征子集作为最优特征组合\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[10  9  6 13  5 12  4 14  8  1  1  1  2  7 11  3]\n",
      "3\n"
     ]
    }
   ],
   "source": [
    "# 4.递归特征消除法\n",
    "selector1 = RFE(RFC_, n_features_to_select=3, step=1).fit(X, Y)       # n_features_to_select表示筛选最终特征数量，step表示每次排除一个特征\n",
    "selector1.support_.sum()\n",
    "print(selector1.ranking_)                                             # 特征排除排序\n",
    "print(selector1.n_features_)                                          # 选择特征数量\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 对于RFECV函数，主要参数如下：\n",
    "1. estimator：一种监督学习估计器，其fit方法通过coef_ 属性或feature_importances_属性提供有关要素重要性的信息\n",
    "2. step：为整数时表示每次要删除的特征数量；小于1时表示每次去除权重最小的特征，默认为1\n",
    "3. min_features_to_select：保留的最少的特征数（但是如果模型有特征数量限制，如随机森林设置了最大特征数，该变量需要大于等于随机森林设定的最大特征数），默认为4. cv：指定交叉验证的折数，默认为5\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.5855656495069493\n"
     ]
    }
   ],
   "source": [
    "X_wrapper1 = selector1.transform(X)                                   # 最优特征\n",
    "score =cross_val_score(RFC_, X_wrapper1, Y, cv=9).mean()# 9折交叉\n",
    "print(score)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.6982684991070736 14\n",
      "[0.5607578228123301, 0.5501203509589253, 0.5666977249786475, 0.5772963739420762, 0.683554623806196, 0.6479540336982685, 0.6396071123534435, 0.6252426430623497, 0.6793229287988197, 0.6752465253513471, 0.6771876698501437, 0.6710148303439707, 0.6876310272536688, 0.6982684991070736]\n"
     ]
    }
   ],
   "source": [
    "# 5.递归特征消除法和曲线图选取最优特征数量\n",
    "score = []                                                            # 建立列表\n",
    "for i in range(1, 15, 1):\n",
    "    X_wrapper = RFE(RFC_, n_features_to_select=i, step=1).fit_transform(X, Y)    # 最优特征\n",
    "    once = cross_val_score(RFC_, X_wrapper, Y, cv=9).mean()                      # 交叉验证\n",
    "    score.append(once)                                                           # 交叉验证结果保存到列表\n",
    "print(max(score), (score.index(max(score))*1)+1)                                 # 输出最优分类结果和对应的特征数量\n",
    "print(score)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABIcAAAEvCAYAAADfBqG/AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAABQEUlEQVR4nO3deXyV5Z3+8eubfd8XkpCEfRMlQNgEl6rUXbTVurZWbR3bWrvMtL8u08600+l02pnp1KmOdQStdbdVwGpVtFpFEUkg7CBISEgCWUgC2bdz//7IAQIECRB4cpLP+/XileSc5yRXHiPkXOe+v4855wQAAAAAAIChKcjrAAAAAAAAAPAO5RAAAAAAAMAQRjkEAAAAAAAwhFEOAQAAAAAADGGUQwAAAAAAAEMY5RAAAAAAAMAQFuJ1gN6kpKS4ESNGeB0DAAAAAABg0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SVQOOd+6JzLVvc5u9frPAOd/wWDH2qQF2mUQxhQzCxU3cXQk865F7zOE2j821TeFjOv+mKupGvMbKekZyRdZGZPeBspMDjnKvxvq9Q9/2Wmt4kCQpmksh6r+v6o7rIIfXO5pNXOuUqvgwSISyQVO+eqnXMdkl6QdK7HmQKCc26hc26ac+58dW8p2OZ1pgBSaWYZkuR/W+VxHgwBZna7pKsk3eqcG5RbfU6zpyR91usQAWC0ul9wWet/7jBc0mozG+Zpqn5GOYQBw8xM3fM4Njvn/svrPIHCzFIPXJ3BzCLV/aRgi6ehAoBz7vvOueHOuRHq3q7yV+ccr6wfh5lFm1nsgfclfVrdWzHwCZxzeyTtMrPx/psulrTJw0iB5maxpexElEqabWZR/n9bLxYD0PvEzNL8b3PUPSSYn7u+Wyrpdv/7t0ta4mEWDAFmdpmk/yfpGudcs9d5AsURg/avEc8bjss5t945l+acG+F/7lAmaZr/97tBI8TrAIORmT0t6UJJKWZWJumfnHMLvU0VEOZK+ryk9f75OZL0A+fcK95FCggZkn5vZsHqLnyfc85xWXacLumSXux+vqkQSU855171NlLA+LqkJ/1bpHZIusPjPAHBv5R7vqS/8zpLoHDOrTSzP0pare6tFmskPextqoDxJzNLltQh6WvOuTqvAw1Evf2uK+kXkp4zs7vUXVDe4F3CgekY561W0v9ISpX0spkVOecu9S7lwHSMc/d9SeGSlvl/L/nAOXePZyEHoGOctyv8L1b5JJVI4pwdYag+nzdW3wEAAAAAAAxdbCsDAAAAAAAYwiiHAAAAAAAAhjDKIQAAAAAAgCGMcggAAAAAAGAIoxwCAAAAAAAYwiiHAAAAAAAAhjDKIQAAAAAAgCGMcggAAAAAAGAI+/9ONZCmuRSYOQAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 1440x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=[20, 5])\n",
    "plt.plot(range(1, 15, 1), score)\n",
    "plt.xticks(range(1, 15, 1))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(480, 12)"
      ]
     },
     "execution_count": 138,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_wrapper = RFE(RFC_, n_features_to_select=12, step=1).fit_transform(X, Y) \n",
    "X_wrapper.shape\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "metadata": {},
   "outputs": [],
   "source": [
    "x_train, x_test, y_train, y_test = train_test_split(X_wrapper,Y, test_size = 0.20, random_state = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\linear_model\\_logistic.py:444: ConvergenceWarning: lbfgs failed to converge (status=1):\n",
      "STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.\n",
      "\n",
      "Increase the number of iterations (max_iter) or scale the data as shown in:\n",
      "    https://scikit-learn.org/stable/modules/preprocessing.html\n",
      "Please also refer to the documentation for alternative solver options:\n",
      "    https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression\n",
      "  n_iter_i = _check_optimize_result(\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style>#sk-container-id-4 {color: black;background-color: white;}#sk-container-id-4 pre{padding: 0;}#sk-container-id-4 div.sk-toggleable {background-color: white;}#sk-container-id-4 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-4 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-4 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-4 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-4 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-4 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-4 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-4 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-4 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-4 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-4 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-4 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-4 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-4 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-4 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-4 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-4 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-4 div.sk-item {position: relative;z-index: 1;}#sk-container-id-4 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-4 div.sk-item::before, #sk-container-id-4 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-4 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-4 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-4 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-4 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-4 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-4 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-4 div.sk-label-container {text-align: center;}#sk-container-id-4 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-4 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-4\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>LogisticRegression(random_state=0)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-4\" type=\"checkbox\" checked><label for=\"sk-estimator-id-4\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">LogisticRegression</label><div class=\"sk-toggleable__content\"><pre>LogisticRegression(random_state=0)</pre></div></div></div></div></div>"
      ],
      "text/plain": [
       "LogisticRegression(random_state=0)"
      ]
     },
     "execution_count": 140,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "\n",
    "#训练并且测试模型\n",
    "#1.逻辑回归模型\n",
    "Logit=LogisticRegression(random_state=0)\n",
    "Logit.fit(x_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 141,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Predict [2 2 1 2 2 2 0 1 1 1 2 1 0 1 2 2 2 1 2 0 1 2 2 2 0 0 2 2 0 1 0 1 2 2 0 1 0\n",
      " 2 2 2 2 1 0 0 2 2 0 2 1 2 0 0 0 1 2 2 2 1 2 2 2 2 0 2 0 2 2 2 1 1 1 1 2 1\n",
      " 2 1 2 1 2 1 0 2 0 1 1 0 2 0 2 0 2 0 0 2 2 0]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(96,)"
      ]
     },
     "execution_count": 141,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#2.模型预测\n",
    "\n",
    "Predict=Logit.predict(x_test)\n",
    "print('Predict',Predict)\n",
    "Predict.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 142,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "15     2\n",
       "124    1\n",
       "141    1\n",
       "263    2\n",
       "170    0\n",
       "      ..\n",
       "416    0\n",
       "417    0\n",
       "107    0\n",
       "462    2\n",
       "188    0\n",
       "Name: Class, Length: 96, dtype: int8"
      ]
     },
     "execution_count": 142,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "metadata": {},
   "outputs": [],
   "source": [
    "#3.模型测试\n",
    "\n",
    "Score=accuracy_score(y_test,Predict)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy 0.6979166666666666\n"
     ]
    }
   ],
   "source": [
    "print('accuracy',Score)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.12 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "e42634819b8c191a5d07eaf23810ff32516dd8d3875f28ec3e488928fbd3c187"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
